/**
 *
 NOT_PAY("1", "未付款"), PAY_OK("2", "已付款"), NOT_SHIPMENTS("3", "未发货"),
 SHIPMENTS_OK("4", "已发货"), TRAD_SUCESS("5", "交易成功"), TRAD_COLSE("6", "交易关闭"),
 EVALUATE("7", "待评价"),
 */
export const orderDict = [
  {code: 'NOT_PAY', codeName: '未付款', color: "rgba(255,127,13,0.98)"},
  {code: 'PAY_OK', codeName: '已付款', color: "#2db7f5"},
  {code: 'SHIPMENTS_OK', codeName: '已发货', color: "rgba(255,0,0,0.35)"},
  {code: 'TRAD_SUCESS', codeName: '交易成功', color: "#096d35"},
  {code: 'TRAD_COLSE', codeName: '交易关闭', color: "#bbbbbb"},
  {code: 'EVALUATE', codeName: '待评价', color: "#2af551"},
  {code: 'RETURN', codeName: '退款申请', color: "#ff0000"},
];


export function orderGetName(code, returnStatus){

  if (code == "RETURN"){
    switch (returnStatus) {
      case 'RETURN_CHECK':
        return "申请退款";
      case 'RETURNING':
        return "退款中";
      case 'RETURN_SUCESS':
        return "退款成功";
      case 'RETURN_FAIL':
        return "退款失败";
    }
  }

  for (let i = 0; i < orderDict.length; i++) {
    if (orderDict[i].code === code)
      return orderDict[i].codeName;
  }

  return "未知";
}

export function orderGetColor(code){

  for (let i = 0; i < orderDict.length; i++) {
    if (orderDict[i].code === code)
      return orderDict[i].color;
  }


  return "未知";
}
